Skip to content

gh-153631: Move to macos-26 runner for iOS#153632

Merged
freakboy3742 merged 4 commits into
python:mainfrom
freakboy3742:ios-macos-26
Jul 13, 2026
Merged

gh-153631: Move to macos-26 runner for iOS#153632
freakboy3742 merged 4 commits into
python:mainfrom
freakboy3742:ios-macos-26

Conversation

@freakboy3742

@freakboy3742 freakboy3742 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Switches CI configuration to use macos-26 for iOS builds. macOS-14 is now in the deprecation window (with full deprecation by November); other Apple workflows are already on macOS-26.

This was previously proposed in #145099, but had to be rolled back due to a stability issue in the workflow. I've now identified the source of the stability problem.

The iOS simulator is managed by a daemon (CoreSimulatorService); and when the daemon is starting (or re-starting), xcodebuild will report that there are no simulators. It appears that Xcode doesn't block on the availability of CoreSimulatorService - it just returns an empty list if the service isn't running.

You can verify this manually by running python Platforms/Apple iOS ci --fast-ci to build the framework and create a testbed project; then run:

sudo pkill -f CoreSimulatorService; xcodebuild -showdestinations -scheme iOSTestbed -project cross-build/iOS-testbed.1783905783081/iOSTestbed.xcodeproj

(substituting the testbed folder that was generated). In my testing (on an M5 MacBook), about 2 in 3 of those runs will fail, and only display the minimal iOS target list, not the full list of available devices.

However, if you run:

sudo pkill -f CoreSimulatorService; xcrun simctl list devices; xcodebuild -showdestinations -scheme iOSTestbed -project cross-build/iOS-testbed.1783905783081/iOSTestbed.xcodeproj
  • that is, explicitly call simctl before calling xcodebuild - it may take several seconds for simctl to respond, but when it does, both simctl, and then and xcodebuild, will return a full list of devices.

When running the Platforms/Apple script providing an explicit simulator, the first simulator call that is made is to xcodebuild with that specific simulator. However, if you fall back to the "default" behavior, the script calls simctl to determine the available simulators, which blocks until CoreSimulatorService is running.

As a side effect, it also means that the script is resilient to changes in simulator image. This will be a particular concern with the macOS-26 image, as Github has indicated that they're going to be more aggressive about updating the Xcode versions that are available, and more aggressive in pruning older versions. iOS 26.5 is the default today; it wasn't when the macOS-26 image was launched. Since there's no automated trigger for bumping Python's CI configuration, and there's a significant performance penalty to using a non-default simulator, using an automated discovery-based scheme seems prudent going forward.

I have now run the iOS CI step 15 times (on commit 078ed9a), and it has passed every time; see CI run history for details. Previously, it would always fail within at least 10 runs (see this comment)

I've also modified the testbed script to always determine the default simulator, even if that default isn't used; it's a cheap operation, but it should guarantee a simulator is available if someone does have an explicit simulator defined.

@freakboy3742 freakboy3742 added skip news needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 12, 2026
@freakboy3742 freakboy3742 merged commit 2dc1a91 into python:main Jul 13, 2026
58 checks passed
@freakboy3742 freakboy3742 deleted the ios-macos-26 branch July 13, 2026 22:38
@miss-islington-app

Copy link
Copy Markdown

Thanks @freakboy3742 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @freakboy3742, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 2dc1a91af801ea896e21f6c6e6cc41f57e8268d9 3.14

@bedevere-app

bedevere-app Bot commented Jul 13, 2026

Copy link
Copy Markdown

GH-153673 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 13, 2026
@miss-islington-app

Copy link
Copy Markdown

Sorry, @freakboy3742, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 2dc1a91af801ea896e21f6c6e6cc41f57e8268d9 3.13

@bedevere-app

bedevere-app Bot commented Jul 13, 2026

Copy link
Copy Markdown

GH-153674 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 13, 2026
@bedevere-app

bedevere-app Bot commented Jul 13, 2026

Copy link
Copy Markdown

GH-153675 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 13, 2026
freakboy3742 added a commit that referenced this pull request Jul 13, 2026
)

Switches iOS CI to use the macos-26 runner, and makes a small change to the iOS
build script to improve build stability. xcodebuild doesn't guarantee that the
CoreSimulatorService is running before starting a simulator. If the service
isn't running, xcodebuild reports that no simulators are available, and fails to
start the test app. However, simctl blocks until the simulator is available, and
simctl is used to evaluate the default simulator. So - the iOS build script now
unconditionally determines the default simulator, even if a specific simulator
is requested.
(cherry picked from commit 2dc1a91)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
hugovk pushed a commit that referenced this pull request Jul 14, 2026
)

Switches iOS CI to use the macos-26 runner, and makes a small change to the iOS
build script to improve build stability. xcodebuild doesn't guarantee that the
CoreSimulatorService is running before starting a simulator. If the service
isn't running, xcodebuild reports that no simulators are available, and fails to
start the test app. However, simctl blocks until the simulator is available, and
simctl is used to evaluate the default simulator. So - the iOS build script now
unconditionally determines the default simulator, even if a specific simulator
is requested.
(cherry picked from commit 2dc1a91)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants